package com.vehicle.domains.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class BasePage<T> {
    private Long total=0L;
    private int pages;
    private List<T> list;

    public static <T> BasePage<T> generateResult(Long total, int pages, List<T> list) {
        BasePage<T> result = new BasePage<>();
        result.setTotal(total);
        result.setPages(pages);
        result.setList(list);
        return result;
    }
}
